﻿<%@ Control Language="C#" %>

<script language="c#" runat="server">
    string _subpath = "";
    public string subpath
    {
        set { _subpath = value; }
        get { return _subpath; }
    }
    public string pics = "";
    public string links = "";
    public string texts = "";
    private string sql = "";
    private int len = 20;
    private int _width = 250;
    private int _hight = 160;
    System.Data.DataTable dt = null;
    public int width
    {
        set { _width = value; }
    }
    public int height
    {
        set { _hight = value; }
    }
    public string Sql
    {
        set { sql = value; }
    }
    public int StrLen
    {
        set { len = value; }
    }
    string path = "imgurl";
    protected void Page_Load(object sender, EventArgs e)
    {
       
            dt = db.common.RunQuery(sql);

        int i = 0;
        string title = "";
        if (dt != null&&dt.Rows.Count>0)
        {
            for (i = 0; i < dt.Rows.Count - 1; i++)
            {
                pics += subpath+dt.Rows[i][path].ToString() + "|";
                links += "detail_tp.aspx?id=" + dt.Rows[i]["id"].ToString() + "|";
                title = dt.Rows[i]["title"].ToString();
                title = title.Length > len ? title.Substring(0, len - 2) + "..." : title;
                texts += title + "|";//' +" + "'1/4.jpg'" + " + '| '+" + "'1/2.jpg'" + "+ '| '+" + "'1/3.jpg'";
            }
            pics += subpath + dt.Rows[i][path].ToString();
            links += "detail_tp.aspx?id=" + dt.Rows[i]["id"].ToString();
            title = dt.Rows[i]["title"].ToString(); 
            title = title.Length > len ? title.Substring(0, len - 2) + "..." : title;
            texts += title ;
        }
    }   
</script>

<table border=0 cellpadding=0  cellspacing=0  ><tr><td>

    <script type="text/javascript">
var focus_width=<%=_width%>
var focus_height=<%=_hight %>
var text_height=20
var swf_height = focus_height+text_height
var pics="<%=pics%>";
var links="<%=links%>";
var texts="<%=texts%>";
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptaccess" value="sameDomain"><param name="wmode" value="transparent"><param name="movie" value="/ascx/imglist/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value=#ffffff>');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="/ascx/imglist/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor=#ffffff quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
    </script>

</td></tr></table>
